package com.hazardSoft.eStore.models;

import java.util.List;

import com.hazardSoft.eStore.entities.Product;
import com.hazardSoft.eStore.entities.Sale;
import com.hazardSoft.eStore.entities.User;

public class ClientBuyProductsModel {
	
	private String keyWords;
	private boolean showResult;
	
	private List<Product> productList;
	private List<Sale> saleList;
	
	private int productId;
	private int quantity;
	
	private Product product;
	
	private int row;
	
	private double totalCost;
	private double totalCostOffer;
	
	private User user;

	public String getKeyWords() {
		return keyWords;
	}

	public void setKeyWords(String keyWords) {
		this.keyWords = keyWords;
	}

	public boolean isShowResult() {
		return showResult;
	}

	public void setShowResult(boolean showResult) {
		this.showResult = showResult;
	}

	public List<Product> getProductList() {
		return productList;
	}

	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}

	public int getProductId() {
		return productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public int getRow() {
		return row;
	}

	public void setRow(int row) {
		this.row = row;
	}

	public List<Sale> getSaleList() {
		return saleList;
	}
	public void setSaleList(List<Sale> saleList) {
		this.saleList = saleList;
	}

	public double getTotalCost() {
		double cost = 0;
		if(saleList!=null){
			for (Sale sale : saleList) {
				cost += sale.getCost();
			}
		}
		totalCost = cost;
		return totalCost;
	}

	public void setTotalCost(double totalCost) {
		this.totalCost = totalCost;
	}

	public double getTotalCostOffer() {
		
		totalCostOffer = totalCost-(totalCost*0.2);
		
		return totalCostOffer;
	}

	public void setTotalCostOffer(double totalCostOffer) {
		this.totalCostOffer = totalCostOffer;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}
